package com.woniuxy.oldmanapi.mapper;

import com.woniuxy.oldmanapi.entity.Electricity;
import com.woniuxy.oldmanapi.yvo.ElectricityVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface ElectricityMapper extends Mapper<Electricity> {

    List<ElectricityVo> initSelectAllByCons(@Param("buildingId") int buildingId, @Param("storeyId") int storeyId, @Param("roomId") int roomId);

    @Update("update electricity set electricityStatus = #{status} where id = #{id}")
    void modifyStatus(@Param("id") Integer id, @Param("status") Integer status);

    ElectricityVo selectById(Integer id);
}